﻿#include "gdal/include/gdal_priv.h"
#include "gdal/include/gdalwarper.h"
#include "gdal/include/ogrsf_frmts.h"
#pragma comment(lib,"gdal/gdal_i.lib")

#include "ScanLine.h"
#include "RasterIO.h"
#include "VectorIO.h"
#include "BayesDecision.h"
#include "MatrixSF.h"
#include "TrainRateDlg.h"
#include "ExpectationMax.h"
#include "FuzzyCMeans.h"

// BayesDlg.h: 头文件
//

#pragma once


// CBayesDlg 对话框
class CBayesDlg : public CDialogEx
{
// 构造
public:
	CBayesDlg(CWnd* pParent = nullptr);	// 标准构造函数

// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_BAYES_DIALOG };
#endif

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持


// 实现
protected:
	HICON m_hIcon;

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedButtonTifin();
	afx_msg void OnBnClickedButtonShpin();
	afx_msg void OnBnClickedButtonRun();

	BOOL ReadFile();

	CString sTifPathIn;
	CString sShpPathIn;
	CString sTifPathOut;
	CString sConPathOut;

	ScanLine Scan;

	Matrix MatrixF;
	CDC * pDC;
	TrainRateDlg TrainRate;

	CProgressCtrl* pProg;
	afx_msg void OnBnClickedButtonEdit();
	CButton m_btnedit;
	CButton m_btneditshp;

	BayesD BayesDe;
	ExpectationMax ExMax;
	FuzzyCMeans FCMeans;

	BOOL Get_Mean_Value();
	BOOL Get_Con_Mat();
	BOOL Get_Class();
	BOOL Write_Out_Result();

	int ModelFlag;

	afx_msg void OnBnClickedRadio1();
	afx_msg void OnBnClickedRadio2();
	afx_msg void OnBnClickedRadio3();
	CButton m_Radio;
	CButton m_btnrun;

	afx_msg void OnBnClickedCheckEm();
	CEdit mEMtimes;
	CEdit mEMchangerate;

	BOOL EMflag;
	BOOL FCMflag;
	afx_msg void OnBnClickedCheckFcm();
	CEdit mFCMtimes;
	CEdit mFCMchangerate;
	CEdit mtimes;
	CEdit mchangerate;
	CButton mModel1;
	CButton mModel2;
	CEdit mLoss11;
	CEdit mLoss12;
	CEdit mLoss13;
	CEdit mLoss14;
	CEdit mLoss15;
	CEdit mLoss21;
	CEdit mLoss22;
	CEdit mLoss23;
	CEdit mLoss24;
	CEdit mLoss25;
	CEdit mLoss31;
	CEdit mLoss32;
	CEdit mLoss33;
	CEdit mLoss34;
	CEdit mLoss35;
	CEdit mLoss41;
	CEdit mLoss42;
	CEdit mLoss43;
	CEdit mLoss44;
	CEdit mLoss45;
	CEdit mLoss51;
	CEdit mLoss52;
	CEdit mLoss53;
	CEdit mLoss54;
	CEdit mLoss55;
	CButton mEMbutton;
};